puts "hi"
@machines = Machine.all

puts rand(1...2)
@machines.each do |machine|
  puts machine.nom_machine
end

Thread.new{
  while(true){
    sleep(1000);
    @incident = Incident.new(:date_detection => '', :machine_id => '', :type_incident_id => '1')
    @incident.save
  }
}
